package com.example.apitesttool.agent;

/**
 * 智能体节点执行结果
 */
public class AgentNodeResult {
    
    private boolean success;
    private String message;
    private String nextNodeName;
    private boolean shouldContinue;
    private Object data;
    
    public AgentNodeResult() {
        this.shouldContinue = true;
    }
    
    public AgentNodeResult(boolean success, String message) {
        this.success = success;
        this.message = message;
        this.shouldContinue = true;
    }
    
    public AgentNodeResult(boolean success, String message, String nextNodeName) {
        this.success = success;
        this.message = message;
        this.nextNodeName = nextNodeName;
        this.shouldContinue = true;
    }
    
    // 静态工厂方法
    public static AgentNodeResult success(String message) {
        return new AgentNodeResult(true, message);
    }
    
    public static AgentNodeResult success(String message, String nextNodeName) {
        return new AgentNodeResult(true, message, nextNodeName);
    }
    
    public static AgentNodeResult failure(String message) {
        return new AgentNodeResult(false, message);
    }
    
    public static AgentNodeResult complete(String message) {
        AgentNodeResult result = new AgentNodeResult(true, message);
        result.setShouldContinue(false);
        return result;
    }
    
    public static AgentNodeResult continueWith(String nextNodeName, String message) {
        return new AgentNodeResult(true, message, nextNodeName);
    }
    
    // Getters and Setters
    public boolean isSuccess() { return success; }
    public void setSuccess(boolean success) { this.success = success; }
    
    public String getMessage() { return message; }
    public void setMessage(String message) { this.message = message; }
    
    public String getNextNodeName() { return nextNodeName; }
    public void setNextNodeName(String nextNodeName) { this.nextNodeName = nextNodeName; }
    
    public boolean isShouldContinue() { return shouldContinue; }
    public void setShouldContinue(boolean shouldContinue) { this.shouldContinue = shouldContinue; }
    
    public Object getData() { return data; }
    public void setData(Object data) { this.data = data; }
}

